/**
 * 
 */
package com.dashboard.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dashboard.dao.PapelDao;
import com.dashboard.domain.Autorizacao;

/**
 * @author Joao
 * 
 */
@Service
public class ServicoPapelImpl implements ServicoPapel {

	private PapelDao papelDao;

	@Autowired
	public ServicoPapelImpl(PapelDao papelDao) {
		this.papelDao = papelDao;
	}

	@Transactional
	public void criar(Autorizacao role) {
		papelDao.persistir(role);
	}
	
	@Transactional
	public void atualizar(Autorizacao role) {
		papelDao.atualizar(role);
	}
	
	@Transactional
	public void remover(Autorizacao role) {
		papelDao.apagar(role);
	}

	public List<Autorizacao> listarTodos() {
		return papelDao.recuperarTodos();
	}

	public Autorizacao recuperar(String id) {
		return papelDao.recuperar(id);
	}
}